package com.itheima.Jiuye12;

import java.io.*;
import java.util.Arrays;

public class ChersStreamDemo {
    public static void main(String[] args) throws IOException {
        //创建字符输入流，进行读
        BufferedReader br = new BufferedReader(new FileReader("mJiuYe\\a.txt"));
        String s = br.readLine();
        br.close();
        String[] s1 = s.split(" ");
        int[] a = new int[s1.length];
        for (int i = 0; i < s1.length; i++) {
            int b = Integer.parseInt(s1[i]);
            a[i] = b;
        }
        Arrays.sort(a);
        BufferedWriter bw = new BufferedWriter(new FileWriter("mJiuYe\\b.txt"));
        for (int i = 0; i < a.length; i++) {
            System.out.println(a[i]);
            bw.write(a[i]+" ");
            bw.flush();
        }
        bw.close();
    }
}
